<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http:www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<include file="./Home/Tpl/Admin/Common/cssjs.html" />
</head>
<body>
<div class="subnav">
  <div class="content-menu ib-a blue line-x"> <a class="add fb" href="{:U("Contents/Position/add")}"><em>添加推荐位</em></a> <a href='{:U("Contents/Position/index")}' class="on"><em>推荐位管理</em></a> </div>
</div>
<style type="text/css">
	html{_overflow-y:scroll}
</style>
<script type="text/javascript">
<!--
$(function(){
	$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
	$("#name").formValidator({onshow:"请输入推荐位名称",onfocus:"推荐位名称不能为空。"}).inputValidator({min:1,max:999,onerror:"推荐位名称不能为空。"});
	$("#maxnum").formValidator({onshow:"请输入最大保存条数",onfocus:"最大保存条数不能为空。"}).inputValidator({min:1,onerror:"最大保存条数不能为空。"}).regexValidator({datatype:'enum',regexp:'intege1',onerror:'最大保存条数不能为空。'}).defaultPassed();;			
})
//-->
</script>
<div class="pad_10">
  <div class="common-form">
    <form name="myform" action="{:U("Contents/Position/add")}" method="post" id="myform">
      <table width="100%" class="table_form contentWrap">
        <tr>
          <td  width="80">推荐位名称</td>
          <td><input type="text" name="info[name]" value="" class="input-text" id="name">
            </input></td>
        </tr>
        <tr>
          <td>所属模型</td>
          <td><?php echo Form::select($modelinfo,'','name="info[modelid]" onchange="category_load(this);"','请选择模型');?></tr>
        <tr>
          <td>所属栏目</td>
          <td id="load_catid"></td>
        </tr>
        <tr>
          <td>排序</td>
          <td><input type="text" name="info[listorder]" id="listorder" class="input-text" size="5" value="">
            </input></td>
        </tr>
        <tr>
          <td>最大保存条数</td>
          <td><input type="text" name="info[maxnum]" id="maxnum" class="input-text" size="5" value="20">
            </input>
            条</td>
        </tr>
      </table>
      <div class="bk15"></div>
      <div class="btn">
      <input name="dosubmit" type="submit" value="提交" class="button">
      </div>
    </form>
  </div>
</div>
<script type="text/javascript">
function category_load(obj)
{
	var modelid = $(obj).attr('value');
	$.get('{$Config.siteurl}index.php?a=public_category_load&m=Position&g=Contents&modelid='+modelid,function(data){
			$('#load_catid').html(data);
		  });
}
</script>
</body>
</html>